package com.hdy.web.dao;

import com.hdy.web.pojo.Comment;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CommentMapper {
    @Select("select * from comments_info where qid=#{qid};")
    List<Comment> getSpecific(@Param("qid") int qid)throws Exception;

    @Insert("insert into comments_info (qid,fromId,content)VALUES " +
            "(#{qid}, #{fromId}, #{content} ) ")
    @Options(useGeneratedKeys=true,keyProperty="entity.mid",keyColumn = "mid")
    int insertComment(@Param("qid") int qid, @Param("fromId") String fromId,
                      @Param("content") String content,@Param("entity") Comment entity);
}
